<template>
	<app-page>
		<wd-config-provider :theme="theme">
			<view class="container">
				<view class="img">
					<image src="@/tools/static/img/tools-header-bg.png"></image>
					<view class="title">工具</view>
				</view>

				<view class="card menu-1">
					<wd-cell-group>
						<wd-cell is-link title="提醒" @click="goPage('/tools/tips/tips')">
							<template #icon>
								<text class="iconfont icon-tixing1"></text>
							</template>
						</wd-cell>
						<wd-cell is-link title="备忘录" @click="goPage('/tools/remark/remark')">
							<template #icon>
								<text class="iconfont icon-ziyuan"></text>
							</template>
						</wd-cell>
					</wd-cell-group>
				</view>
				<view class="card menu-2">
					<wd-cell-group>
						<wd-cell is-link title="赔偿计算" @click="goPage('/tools/indemnify/indemnify')">
							<template #icon>
								<text class="iconfont icon-susongguanli_susonganjianguanli"></text>
							</template>
						</wd-cell>
						<wd-cell is-link title="诉讼费" @click="goPage('/tools/litigation/litigation')">
							<template #icon>
								<text class="iconfont icon-peichang"></text>
							</template>
						</wd-cell>
					</wd-cell-group>
				</view>
				<view class="card menu-3">
					<wd-cell-group>
						<wd-cell is-link title="法律法规查询" @click="goPage('/tools/lawsRegulations/index/index')">
							<template #icon>
								<text class="iconfont icon-gaojichaxun"></text>
							</template>
						</wd-cell>
					</wd-cell-group>
				</view>
				<view class="card menu-4">
					<wd-cell-group>
						<wd-cell is-link title="借贷计算器" @click="goPage('/tools/loan/loan')">
							<template #icon>
								<text class="iconfont icon-jisuanqi"></text>
							</template>
						</wd-cell>
					</wd-cell-group>
				</view>
			</view>
		</wd-config-provider>
	</app-page>

</template>

<script lang="ts">
	import { defineComponent, ref } from 'vue';

	import useRouter from '@/hooks/useRouter.ts';
	export default defineComponent({
		name: '',
		setup(props, ctx) {
			const router = useRouter();

			// 日间light、夜间dark主题
			const theme = ref('light');
			const goPage = (url : string, type = 'push') => {
				if (type === 'push') {
					router.push(url);
				} else if (type === 'tab') {
					router.switchTab(url);
				}
			};
			return {
				theme,
				goPage
			};
		}
	});
</script>
<!-- #ifdef MP-WEIXIN -->
<style lang="less">
	page {
		background-color: #f2f2f2;
	}
</style>
<!-- #endif -->
<style lang="less" scoped>
	page {
		background-color: #f2f2f2;
	}

	.container {
		position: relative;
		padding: 320rpx 24rpx 24rpx;

		background: #f2f2f2;

		:deep(.wd-cell__value) {
			color: #c91c1f;
		}

		.img {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 320rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				position: absolute;
				z-index: 1;
				width: 100%;
				height: 100%;
			}

			.title {
				position: relative;
				z-index: 2;
				font-family: PingFang;
				font-weight: 400;
				font-size: 50rpx;
				color: #ffffff;
			}
		}

		.menu-1,
		.menu-2,
		.menu-3,
		.menu-4 {
			overflow: hidden;
			margin-top: 24rpx;

			.iconfont {
				font-size: 40rpx !important;
				margin-right: 10rpx;
				color: #999999;
			}

			.icon-ziyuan {
				padding-left: 8rpx;
				padding-right: 5rpx;
				font-size: 28rpx !important;
			}

			.icon-susongguanli_susonganjianguanli {
				padding-left: 8rpx;
				padding-right: 5rpx;
				font-size: 30rpx !important;
			}

			.icon-peichang {
				padding-left: 8rpx;
				padding-right: 5rpx;
				font-size: 30rpx !important;
			}

			.icon-gaojichaxun {
				padding-left: 8rpx;
				padding-right: 2rpx;
				font-size: 34rpx !important;
			}

			.icon-jisuanqi {
				padding-left: 8rpx;
				padding-right: 5rpx;
				font-size: 30rpx !important;
			}
		}
	}
</style>